package com.hmall.order.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class OrderListener {
    /**
     * 接收 过期消息
     * @param orderId
     */
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "dl.ttl.queue", durable = "true"),
            exchange = @Exchange(name = "dl.ttl.exchange"),
            key = "dl"
    ))
    public void listenDlQueue(String orderId){
        log.info("接收到 dl.ttl.queue的延迟消息：{}", orderId);
//        调用清理订单的方法，检查orderid对应的status是否已支付，如果没有改状态恢复库存

    }
}
